package com.macro.mall.common.enums;


import com.macro.mall.common.utils.BizInfo;
import lombok.Getter;

@Getter
public enum BizCode implements BizInfo {
    NUMBER_200(200, "成功"),
    LOGIN_EXPIRED(100100, "登录过期"),
    USER_ROLE_LIMIT(100009, "暂不支持已存在套餐用户续费,请联系客服"),
    USER_ROLE_DOWNGRADE(100008, "暂不支持用户降级、平级续费，请联系客服"),
    NOT_LOGGED_IN(100101,"未登录"),
    HAS_EXPIRED(100110,"账号已到期"),
    PC_NOT_SUPPORT(100111,"账号不支持PC端登录"),
    ABNORMAL_LOGIN_INFORMATION(100102,"登录信息异常"),
    USED_MAX(100103,"权限用量已满"),
    DAILY_USED_MAX(100112,"当日用量已满"),
    MONTH_USED_MAX(100112,"当月用量已满"),
    USED_NULL(100104,"无此权限用量"),
    USER_ROLE_OVERDUE(100105,"用户角色过期"),
    USER_LOCATION_ERROR(100108,"用户选择地区不支持"),
    USER_TAG_ERROR(100108,"用户品类异常"),
    SALES_CODE_ERROR(100106,"销售码有误"),
    WECHAT_INFO_ERROR(100107,"微信信息异常"),
    BUSINESS_NAME_NULL(100109,"公司名称没有填写"),
    AUTHORIZATION_ERROR(200102, "鉴权失败"),
    USER_EXIST(200103, "用户名已经存在"),

    PASSWORD_ERROR(200104, "密码错误"),

    SMS_TOO_FREQUENTLY(200105, "短信发送过于频繁"),

    SMS_ERROR(200105, "短信发送错误"),

    CODE_ERROR(200106, "验证码错误或不存在"),

    SEND_FAIL(200107, "发送失败"),

    TOKEN_NOT_EXIST(200108, "认证失败"),

    PHONE_EXIST(200109, "手机号已经注册"),
    PHONE_IS_NUMBER(200109, "手机号非数字"),
    PHONE_FORMAT_ERROR(200109, "手机号非数字"),
    PATH_AUTHORIZATION_ERROR(200100, "暂无此处权限"),
    FOLDER_LEVEL_ERROR(200111, "子收藏层级过高"),
    PARENT_NOT_EXIST(200112, "父灵感集不存在"),
    FOLDER_NOT_EXIST(200112, "无灵感集，请新建"),
    USER_NOT_EXIST(200113, "用户不存在"),
    ENUM_NULL(200114, "枚举为空"),
    USER_LOGOUT_ERROR(200115, "用户登出失败"),
    USER_AVATAR_ERROR(200116, "用户头像信息异常"),
    UPLOAD_AVATAR_ERROR(200117, "用户头像上传失败"),

    CONTENT_NAME_NOT_NULL(200118, "内容名称不能为空"),
    UPLOAD_USERNAME_CAN_NOT_PHONE_NUMBER(200119, "用户名不能与手机格式相同"),
    PERMISSION_ERROR(200120, "权限异常"),
    FOLDER_LEVEL_NAME_EXIST(200121, "同层存在同名收藏夹"),
    FOLDER_CONTENT_NAME_NULL(200122, "名称为空"),
    COLLECT_DATA_REPEAT(200122, "采集数据重复"),
    MONITOR_GROUP_NAME_NULL(200201, "监控分组名为空"),
    MONITOR_REMARK_ERROR(200202, "监控备注异常，可能过长了"),
    MONITOR_GRADE_ENUM_NULL(200203, "监控等级不存在"),
    MONITOR_OBJECT_TYPE_ENUM_NULL(200204, "监控对象类型不存在"),
    MONITOR_GROUP_ID_ERROR(200205,"请选择监控分组"),
    MONITOR_OBJECT_ID_ERROR(200206,"监控对象异常，请刷新界面再监控"),
    MONITOR_ID_ERROR(200207,"监控Id异常" ),
    MONITOR_MENU_TYPE_ERROR(200208,"监控中心菜单类型异常，可能不属于监控中心"),
    MONITOR_OBJECT_ID_EXIST(200206,"存在内容重复监控"),
    MONITOR_RECORD_TALENT_URL_ERROR(200209,"达人链接或ID异常"),
    MONITOR_RECORD_TALENT_ERROR(200210,"小知和小红书的羁绊似乎出现了些许问题，请重试，若无效，请联系客服"),
    MONITOR_EXCEL_ERROR(200211,"excel异常，请按照模版添加" ),
    MONITOR_RECORD_TALENT_NULL(200210,"此达人不存在"),
    SPIDER_ERROR(200211,"爬虫异常"),
    SPIDER_NETWORK_ERROR(200212,"网络请求超时，请重新点击"),
    YI_EN_NOTE_NULL(200213, "艺恩实时笔记接口异常"),
    SCHEME_NAME_NULL(200301,"方案集名称为空"),
    SCHEME_DATA_NAME_NULL(200302,"方案内容名称为空"),
    SCHEME_DATA_IMAGE_URL_NULL(200303,"方案内容图片名称为空"),
    SCHEME_DATA_HIGH_NULL(200304,"方案内容高度为空"),
    SCHEME_DATA_WIDTH_NULL(200305,"方案内容宽度为空"),
    SCHEME_DATA_DATA_SIZE_NULL(200306,"方案内容数据大小为空"),
    SCHEME_DATA_SCHEME_ID_NULL(200307,"所属方案集Id为空"),
    SCHEME_ANNOTATION_NULL(200308,"方案批注为空"),
    SCHEME_DEFAULT_CANT_DELETE(200309,"默认方案集不允许删除"),
    SCHEME_NAME_REPEAT(200310,"方案集名称重复"),
    SCHEME_RESOURCE_MAX(200311,"方案资源超限"),
    SCHEME_LEVEL_MAX(200312,"方案层数已满"),
    SCHEME_MARK_ERROR(200313,"选择打标方案存在问题，请刷新后重试"),
    PRESETS_TALENT_NULL(200315,"暂无此预设分组"),
    SEARCH_IMAGE_ERROR(201001,"图片链接异常"),
    REFRESH_TALENT_ERROR(200313,"数据更新已提交，会在3小时内处理完毕"),
    SPIDER_IMPORT_ERROR(300001,"数据校验异常"),

    // 用户消息相关错误码
    MESSAGE_NOT_EXIST(400001, "消息不存在"),
    MESSAGE_QUERY_ERROR(400002, "消息查询失败"),
    MESSAGE_COUNT_ERROR(400003, "消息统计失败"),
    ;



    private final int code;
    private String message;

    private BizCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BizCode setMessage(String message) {
        this.message = message;
        return this;
    }


    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String msg() {
        return this.message;
    }
}
